import {
  marriageEnum,
  educationalEnum,
  houseEnum,
  carEnum,
  incomeEnum
} from '@/enum'

export const searchConfig = params => {
  return [
    {
      label: '年龄要求',
      prop: 'age',
      type: 'select',
      handleFn: (prop, label) => {
        params.openPopup(prop, label)
      }
    },
    {
      label: '身高要求',
      prop: 'height',
      type: 'select',
      handleFn: (prop, label) => {
        params.openPopup(prop, label)
      }
    },
    {
      label: '学历要求',
      tips: '（可选择多项）',
      tipsPosition: 'right',
      prop: 'edu',
      options: educationalEnum.getOptions()
    },
    {
      label: '地区要求',
      prop: 'region',
      tips: '还可添加一个其他城市作为搜索条件，比如家乡地',
      tipsPosition: 'bottom',
      options: [
        {
          active: true,
          value: 1,
          label: params.region
        },
        {
          active: false,
          value: '',
          label: '+ 其他地区'
        }
      ],
      handleFn: (prop, label, i) => {
        if (i == 0) return
        params.openPopup(prop, label)
      }
    },
    {
      label: '收入要求',
      prop: 'income',
      options: incomeEnum.getOptions()
    },
    {
      label: '婚姻要求',
      prop: 'marriage',
      options: marriageEnum.getOptions()
    },
    {
      label: '房产要求',
      prop: 'house',
      options: houseEnum.getOptions()
    },
    {
      label: '车产要求',
      prop: 'car',
      options: carEnum.getOptions()
    }
  ]
}
